package basicType;

/**
 * TODO: please加入描述
 * @author chenxin
 * @time 2017-03-13-15:56
 */
public class LongTest {
    public static void main(String[] args) {
        long t = System.currentTimeMillis();
        System.out.println(t);
        int sec = Math.toIntExact(t);
        System.out.println(sec);
    }

    private static void maxTest() {
        //        Long a = Long.MAX_VALUE - 1;
        //        Integer b = 2;
        //        Long c = a + b;
        //        System.out.println(c);

        //  获得最大值
        Long maxValue = Long.MAX_VALUE;
        //  计算更新值
        Long beforeValue = Long.MAX_VALUE - 111111;
        Long afterValue = beforeValue + 111112;
        while (afterValue > maxValue) {
            afterValue = afterValue - maxValue;
            System.out.println("afterValue " + afterValue);
        }
        System.out.println("afterValue " + afterValue);

        System.out.println(Integer.MAX_VALUE);
    }
}
